<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./vue.js"></script>
</head>
<body>
   
    <div id="emit-example-simple">
        <welcome-button v-on:welcome="sayHi"></welcome-button>
    </div>
   
</body>
<script>
    Vue.component('welcome-button',{
        template:`
        <button v-on:click="$emit('welcome')"> Click me to be welcomed</button>`
    })
 var vm=new Vue({
   
     el:'#emit-example-simple',
     data:{

     },
     methods:{
         sayHi:function(){
             alert('Hi')
         }
     }
 })
</script>
</html>